package com.elcom.roaming.module.synthesis.isup;

import com.elcom.roaming.common.util.match.ObjectValue;

public class ISUPValue extends ObjectValue{
	public static final char IAM = 'I';
	public static final char REL = 'R';
	
	String calling;
	String calledMSRN;
	String errCode;
	
	public ISUPValue(String errCode) {
		this.type = REL;
		this.errCode = errCode;
	}
	
	public ISUPValue(String calling, String called){
		this.type = IAM;
		this.calling = calling;
		this.calledMSRN = called;
	}
	
	public boolean isIAM(){
		return type == IAM;
	}
	
	public boolean isREL(){
		return type == REL;
	}
	
	public String getCalling() {
		return calling;
	}

	public String getCalledMSRN() {
		return calledMSRN;
	}

	public String getErrCode() {
		return errCode;
	}

	@Override
	public String toString() {
		if (type == 'I')
			return "type=" + type +
					"|calling=" + calling +
					"|calledMSRN=" + calledMSRN +
					"|errCode=" + errCode;
		else 
			return "type=" + type +	"|errCode=" + errCode;
	}

}
